﻿using QMERP.Domain.Dtos;
using QMERP.Domain.PrintModels;

namespace QMERP.Application.Services
{
    public interface ILeaveStockOrderService
    {
        /// <summary>
        /// 出库单窗体
        /// </summary>
        /// <returns></returns>
        Task<PageResponse<LeaveStockOrderResponse>> Query(PageRequest<LeaveStockOrderRequest> request);
        /// <summary>
        /// 获取id的出库单详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<LeaveStockOrderResponse> Detail(long id);
        /// <summary>
        /// 获取对应业务单类型可出库的订单列表
        /// </summary>
        /// <param name="businessOrderType"></param>
        /// <returns></returns>
        Task<List<CanLeaveStockOrderResponse>> GetCanLeaveStockOrders(string businessOrderType);
        /// <summary>
        /// 出库单保存
        /// </summary>
        /// <param name="request"></param>
        /// <param name="isCheck"></param>
        /// <returns></returns>
        Task<LeaveStockOrderResponse> Save(LeaveStockOrderSaveRequest request, bool isCheck = false);
        /// <summary>
        /// 出库单审核
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task Check(long[] ids);
        /// <summary>
        /// 出库单弃审
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task UnCheck(long[] ids);
        /// <summary>
        /// 出库单取消
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="isOther"></param>
        /// <returns></returns>
        /// <exception cref="ApiException"></exception>
        Task Cancel(long[] ids, bool isOther = false);
        /// <summary>
        /// 获取出库单主要信息列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<List<LeaveStockOrderMainInfoResponse>> GetLeaveStockOrderMainInfos(PageRequest<LeaveStockOrderRequest> request);
        /// <summary>
        /// 导出缺少出库
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<LensViewResponse> ExportLackLeaveStock(ExportLackLeaveStockRequest request);
        /// <summary>
        /// 获取出库单打印数据
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task<LeaveStockBill> GetLeaveStockBill(long[] ids);
        /// <summary>
        /// 获取XY表汇总
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<List<LensViewResponse>> GetLensDetailSummary(ExportLensDetailSummaryRequest request);
        /// <summary>
        /// 扫描条码出库
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        /// <exception cref="ApiException"></exception>
        Task ScanBarCodeLeaveStock(ScanBarCodeLeaveStockRequest request);
    }
}
